<script>
	import {
		getLoaction
	} from "@/utils/index.js"
	import {
		getToken,
		getStorageToken
	} from '@/utils/index.js'
	export default {
		onLaunch: async function() {
			try {
				let res = await getToken()
			} catch (error) {
				//TODO handle the exception
				console.log(error, 'error')
			};
		},
		onShow: async function() {
			// 获取当前位置
			let res = await getLoaction();
			let currentLocation = uni.getStorageSync('addressInfo');
			if (!currentLocation || currentLocation.location.lat !== res.location.lat) {
				uni.setStorageSync('addressInfo', res);
				console.log('-------no------');
			}
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	page {
		background-color: #f2f4f7 !important;
	}
</style>